<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 6.3.0">

  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" integrity="sha256-HtsXJanqjKTc8vVQjO4YMhiqFoXkfBsjBWcX91T1jr8=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"example.com","root":"/","images":"/images","scheme":"Pisces","darkmode":false,"version":"8.18.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":false,"style":null},"fold":{"enable":false,"height":500},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":false,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>

    <meta name="description" content="记录使用maven时一些知识点。">
<meta property="og:type" content="article">
<meta property="og:title" content="后端-maven">
<meta property="og:url" content="http://example.com/2023/08/20/%E5%90%8E%E7%AB%AF-maven/index.html">
<meta property="og:site_name" content="小张">
<meta property="og:description" content="记录使用maven时一些知识点。">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2023-08-20T14:33:31.000Z">
<meta property="article:modified_time" content="2023-08-24T09:53:15.463Z">
<meta property="article:author" content="lalalazjf">
<meta property="article:tag" content="java">
<meta property="article:tag" content="maven">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="http://example.com/2023/08/20/%E5%90%8E%E7%AB%AF-maven/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"http://example.com/2023/08/20/%E5%90%8E%E7%AB%AF-maven/","path":"2023/08/20/后端-maven/","title":"后端-maven"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>后端-maven | 小张</title>
  








  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">小张</p>
      <i class="logo-line"></i>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#mvn%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4"><span class="nav-number">1.</span> <span class="nav-text">mvn常用命令</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#maven%E5%B8%B8%E7%94%A8%E7%9A%84%E5%8F%98%E9%87%8F"><span class="nav-number">2.</span> <span class="nav-text">maven常用的变量</span></a></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="lalalazjf"
      src="/images/home_img.jpg">
  <p class="site-author-name" itemprop="name">lalalazjf</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">7</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">5</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>

        </div>
      </div>
    </div>

    
  </aside>


    </div>

    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2023/08/20/%E5%90%8E%E7%AB%AF-maven/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/home_img.jpg">
      <meta itemprop="name" content="lalalazjf">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="小张">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="后端-maven | 小张">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          后端-maven
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2023-08-20 22:33:31" itemprop="dateCreated datePublished" datetime="2023-08-20T22:33:31+08:00">2023-08-20</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-08-24 17:53:15" itemprop="dateModified" datetime="2023-08-24T17:53:15+08:00">2023-08-24</time>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody"><p>记录使用maven时一些知识点。</p>
<span id="more"></span>

<h3 id="mvn常用命令"><a href="#mvn常用命令" class="headerlink" title="mvn常用命令"></a>mvn常用命令</h3><p>查询pom.xml完整依赖命令  <code> mvn help:effective-pom</code></p>
<p>关于maven的生命周期和插件，我们可以从官方文档中了解更多信息：<br>maven的生命周期：<a target="_blank" rel="noopener" href="https://maven.apache.org/ref/3.8.6/maven-core/lifecycles.html">https://maven.apache.org/ref/3.8.6/maven-core/lifecycles.html</a><br>maven生命周期绑定的默认插件：<a target="_blank" rel="noopener" href="https://maven.apache.org/ref/3.8.6/maven-core/default-bindings.html">https://maven.apache.org/ref/3.8.6/maven-core/default-bindings.html</a></p>
<h3 id="maven常用的变量"><a href="#maven常用的变量" class="headerlink" title="maven常用的变量"></a>maven常用的变量</h3><p>Maven是一个流行的项目构建和管理工具，它使用一些常用的内置变量来提供项目的元数据和属性。这些变量可以在项目的POM（Project Object Model）文件中使用，以便于配置和管理项目。</p>
<p>以下是一些常用的Maven内置变量：</p>
<ol>
<li><p><strong><code>$&#123;project.groupId&#125;</code></strong>: 项目的groupId，用于标识项目所属的组织或公司。</p>
</li>
<li><p><strong><code>$&#123;project.artifactId&#125;</code></strong>: 项目的artifactId，用于标识项目本身。</p>
</li>
<li><p><strong><code>$&#123;project.version&#125;</code></strong>: 项目的版本号。</p>
</li>
<li><p><strong><code>$&#123;project.name&#125;</code></strong>: 项目的名称。</p>
</li>
<li><p><strong><code>$&#123;project.description&#125;</code></strong>: 项目的描述。</p>
</li>
<li><p><strong><code>$&#123;project.build.directory&#125;</code></strong>: 构建目录，通常是<code>$&#123;project.basedir&#125;/target</code>，用于存放构建输出。</p>
</li>
<li><p><strong><code>$&#123;project.build.outputDirectory&#125;</code></strong>: 项目编译后的类文件输出目录。</p>
</li>
<li><p><strong><code>$&#123;project.build.sourceDirectory&#125;</code></strong>: 项目源代码目录。</p>
</li>
<li><p><strong><code>$&#123;project.build.testOutputDirectory&#125;</code></strong>: 测试编译后的类文件输出目录。</p>
</li>
<li><p><strong><code>$&#123;project.build.testSourceDirectory&#125;</code></strong>: 测试源代码目录。</p>
</li>
<li><p><strong><code>$&#123;project.build.finalName&#125;</code></strong>: 构建输出的最终文件名，通常由<code>$&#123;project.artifactId&#125;-$&#123;project.version&#125;</code>组成。</p>
</li>
<li><p><strong><code>$&#123;project.basedir&#125;</code></strong>: 项目根目录。</p>
</li>
<li><p><strong><code>$&#123;user.home&#125;</code></strong>: 用户主目录，通常是<code>/Users/&lt;用户名&gt;</code>（Linux&#x2F;Mac）或<code>C:\Users\&lt;用户名&gt;</code>（Windows）。</p>
</li>
<li><p><strong><code>$&#123;java.home&#125;</code></strong>: Java安装目录。</p>
</li>
<li><p><strong><code>$&#123;maven.home&#125;</code></strong>: Maven安装目录。</p>
</li>
<li><p><strong><code>$&#123;project.reporting.outputDirectory&#125;</code></strong>: 报告输出目录，用于存放项目文档和报告。</p>
</li>
<li><p><strong><code>$&#123;project.url&#125;</code></strong>: 项目的URL。</p>
</li>
<li><p><strong><code>$&#123;project.build.sourceEncoding&#125;</code></strong>: 项目源代码的编码。</p>
</li>
<li><p><strong><code>$&#123;project.dependencies&#125;</code></strong>: 项目的依赖列表。</p>
</li>
<li><p><strong><code>$&#123;project.build.plugins&#125;</code></strong>: 项目使用的构建插件列表。</p>
</li>
</ol>
<p>这些变量可以在项目的POM文件中的各个地方使用，如属性、插件配置、依赖等。通过使用这些变量，你可以使POM文件更加灵活和可配置，同时减少了硬编码的情况，从而提高项目的维护性和可重用性。</p>

    </div>

    
    
    

    <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/java/" rel="tag"># java</a>
              <a href="/tags/maven/" rel="tag"># maven</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/2023/08/20/%E5%90%8E%E7%AB%AF-%E5%9F%BA%E7%A1%80%E5%B8%B8%E7%94%A8/" rel="prev" title="后端-基础常用">
                  <i class="fa fa-angle-left"></i> 后端-基础常用
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/2023/08/21/%E5%90%8E%E7%AB%AF-%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95/" rel="next" title="后端-单元测试">
                  后端-单元测试 <i class="fa fa-angle-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">

  <div class="copyright">
    &copy; 
    <span itemprop="copyrightYear">2023</span>
    <span class="with-love">
      <i class="fa fa-heart"></i>
    </span>
    <span class="author" itemprop="copyrightHolder">lalalazjf</span>
  </div>
  <div class="powered-by">由 <a href="https://hexo.io/" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/pisces/" rel="noopener" target="_blank">NexT.Pisces</a> 强力驱动
  </div>

    </div>
  </footer>

  
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up fa-lg"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/hexo-generator-searchdb/1.4.1/search.js" integrity="sha256-1kfA5uHPf65M5cphT2dvymhkuyHPQp5A53EGZOnOLmc=" crossorigin="anonymous"></script>
<script src="/js/third-party/search/local-search.js"></script>







  





</body>
</html>
